package com.ljxy.score.controller.myController;


import com.ljxy.score.common.Result;
import com.ljxy.score.entity.domain.TeacherRegister;
import com.ljxy.score.entity.domain.UserRegister;
import com.ljxy.score.service.mystudentService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/student")
public class MyStudentController {
    @Resource
    private mystudentService service;

    @PostMapping("/register")
    public Result<?> register(@RequestBody UserRegister userRegister) {
        return service.register(userRegister.getStuId(), userRegister.getPassword());
    }


    @PostMapping("/login")
    public Result<?> login(@RequestBody UserRegister userRegister
    ) {
        return service.login(userRegister.getStuId(), userRegister.getPassword(),userRegister.getClassId());
    }

}
